package com.asset.dispoal.business.appoint.domain.db.mapper;


import com.asset.dispoal.business.appoint.domain.db.entity.CaseAppoint;
import com.asset.dispoal.business.appoint.domain.dto.IdCaseState;
import com.asset.dispoal.business.appoint.dto.AppointDetailResponse;
import com.asset.dispoal.business.appoint.dto.AppointPageRequest;
import com.asset.dispoal.business.appoint.dto.AppointPageResponse;
import com.asset.dispoal.business.appoint.dto.QueryAppointCaseRequest;
import com.asset.dispoal.business.appoint.dto.QueryDropAppointRequest;
import com.asset.dispoal.business.bsAgreement.domain.db.entity.BsCaseAppointMapper;
import com.asset.dispoal.business.bsCase.dto.BsCaseResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import tech.mhuang.pacebox.springboot.protocol.data.Page;

import java.util.Date;
import java.util.List;
import java.util.Set;


/**
 * @author qr
 * @date 2022/5/17$
 */
@Mapper
public interface AppointMapper {

    Integer insert(CaseAppoint caseAppoint);

    Integer insertRecord(CaseAppoint caseAppoint);

    Integer queryDropCountByAppointId(@Param("appointId") String withdrawalAppointId);

    Integer removeDropId(@Param("id") String withdrawalAppointId);

    Integer removeCaseIdList(@Param("caseIdList") List<String> caseIdList);

    Integer queryCount(AppointPageRequest request);

    List<AppointPageResponse> queryPage(Page<AppointPageRequest> page);

    List<BsCaseResponse> queryDetailByAppoint(QueryAppointCaseRequest request);

    List<AppointPageResponse> queryDropByAssetInstBatchId(QueryDropAppointRequest request);

    List<IdCaseState> queryCaseIdListByAppointId(String appointId);

    Set<String> queryCaseIdListByAppointIdAndIdCardList(@Param("appointId") String appointId,
                                                        @Param("idCardSet") Set<String> idCardSet);

    Integer deleteById(String appointId);

    List<AppointPageResponse> queryByAssetInstBatchId(QueryDropAppointRequest request);

    Integer queryDropById(@Param("appointId") String appointId);

    Integer insertDrop(String appointId);

    Integer deleteMapperByAppointId(@Param("appointId") String appointId,
                                    @Param("withdrawalCaseIdSet") Set<String> withdrawalCaseIdSet);

    Integer insertMapperRecord(@Param("item") BsCaseAppointMapper caseAppointMapper);

    Integer insertMapper(@Param("item") BsCaseAppointMapper caseAppointMapper);

    Integer updateSue(@Param("appointId") String appointId,
                      @Param("calculationDate") Date calculationDate);

    Integer downloadOrder(CaseAppoint caseAppoint);

    AppointDetailResponse getAppointDetailById(String id);

    void updateAddress(@Param("appointId") String appointId,
                       @Param("evidenceAddress") String evidenceAddress,
                       @Param("deliverNum") int size,
                       @Param("deliverTime") Date currentDate);

    Integer queryCountNumberByAppointIdNotState(@Param("appointId") String appointId,
                                                @Param("caseState") String label);

    IdCaseState getIdCaseStateByCaseId(@Param("caseId") String id);

    Integer queryCountByAppointId(@Param("appointId") String appointId);

    Integer deleteMapperByCaseId(String caseId);

    Integer insertConf(@Param("appointId") String id, @Param("detailIdList") List<String> evidenceConfItemDetailId);
}
